<?php 
namespace App\Services;

use App\Facades\Infra\AdminManager;
use App\Facades\Utils\ValidateParameter;
use App\Facades\Utils\LogUtil;
use Auth;

class SetService{
	public function update($request){
		$rules = [
			'bmi_section' => 'required|numeric',
			'age_section' => 'required|numeric',
			'weight_section' => 'required|numeric',
		];

		ValidateParameter::validate($request,$rules);

		$data=$request->all();

		AdminManager::updateSet($data);

		LogUtil::updateLog(Auth::user()->name,'修改了搜索区间');
	}

	public function getSet(){
		return AdminManager::getSet();
	}
}